import { createSlice } from '@reduxjs/toolkit';

const initialState = {
  latestArticles: [],
  teachHotArticles: [],
}

const articlesSlice = createSlice({
  name: 'articles',
  initialState,
  reducers: {
    setLatestArticles: (state, action) => {
      state.latestArticles = action.payload;
    },
    setTeachHotArticles: (state, action) => {
      state.teachHotArticles = action.payload;
    },

  },
})

export const { setLatestArticles, setTeachHotArticles } = articlesSlice.actions;
export default articlesSlice.reducer;